package com.panopset.site.jnlp;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JPanel;

import com.panopset.compat.Strings;
import com.panopset.nls.MsgProps;
import com.panopset.sf.Windoc;
import com.panopset.sf.jnlp.AbstractPanopsetSwingFrame;

/**
 * Simplest SwingFrame application.
 * 
 * @author Karl Dinwiddie
 * 
 */
public final class HelloWorld extends AbstractPanopsetSwingFrame {

	/**
	 * @param args
	 *            Not used.
	 */
	public static void main(final String[] args) {
		new HelloWorld().show();
	}

	/**
	 * Prevent instantiation.
	 */
	private HelloWorld() {
	}

	@Override
	public JPanel createPanel(final Windoc doc) {
		JPanel p = new JPanel();
		p.setLayout(new GridBagLayout());
		GridBagConstraints gbc = new GridBagConstraints();
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.weightx = 1.0;
		p.add(doc.createPanTextField(Strings.capitalize(

		new MsgProps(HW_MSG_PROPS).get("msg")),

		new MsgProps(HW_MSG_PROPS).get("hw")).getPanel(), gbc);
		return p;
	}

	/**
	 * Each application should have its own resource bundle for <a
	 * href="http://www.i18nguy.com/origini18n.html">i18n</a>.
	 */
	public static final String HW_MSG_PROPS = "com/panopset/nls/hw";

}
